package utility;

import java.awt.Color;
import java.util.Random;

public class RandomStuff {

	public static Color randomColor() {
		Random r = new Random();
		return new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255));
	}

	public static Color average(Color... colors) {
		double rtotal = 0;
		double gtotal = 0;
		double btotal = 0;

		int nc = 0;
		for (Color color : colors) {
			nc += color.getAlpha();
			rtotal += (double) color.getRed() * ((double) color.getAlpha() / 255.0);
			gtotal += (double) color.getGreen() * ((double) color.getAlpha() / 255.0);
			btotal += (double) color.getBlue() * ((double) color.getAlpha() / 255.0);
		}
		rtotal /= nc;
		gtotal /= nc;
		btotal /= nc;
		return null;
	}

}
